package example.controller;

import example.entity.MyObj;
import example.entity.User;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangguoqing
 */
@RestController
public class TestController {

    @RequestMapping("/test")
    public void test() {
        System.out.println("testController test method");
    }

    @RequestMapping("/testHttpClient")
    public List<User> testHttpClient() {
//        List<String> strList = new ArrayList<>();
//        strList.add("张三");
//        strList.add("李四");
//        strList.add("王五");

        List<User> strList = new ArrayList<>();
        return strList;
    }

    @PostMapping("/method01")
    public void method01(MyObj myObj) {
        System.out.println(myObj);
    }

    @PostMapping("/method02")
    public void method02(@RequestBody MyObj myObj) {
        System.out.println(myObj);
    }

}
